#ifndef __WorkerThread_H__
#define __WorkerThread_H__

#include "Thread.hpp"
#include "Threadpool.hpp"

namespace wd
{

class WorkerThread
: public Thread
{
public:
    WorkerThread(Threadpool & pool)
    : _pool(pool)
    {}

    void run() override
    {
        //每一个子线程都要执行的任务
        _pool.doTask();
    }

private:
    Threadpool & _pool;
};

}//end of namespace wd

#endif

